package com.dykj.fireFighting.api.socialUnit.devHis.service;



import com.dykj.fireFighting.api.socialUnit.devHis.dto.AlarmRecordDto;
import com.dykj.fireFighting.api.socialUnit.devHis.dto.DevHisDto;
import com.dykj.fireFighting.api.socialUnit.devHis.entity.AlarmRecord;
import com.dykj.fireFighting.api.socialUnit.devHis.entity.DevHis;
import com.dykj.fireFighting.api.socialUnit.devHis.vo.DevHisVo;
import com.dykj.fireFighting.common.core.service.IBaseService;
import com.dykj.fireFighting.common.core.vo.PageVo;

import java.util.Map;

/**
 * 火灾自动报警设备运行记录
 *
 * @Author hxb
 * @Date 2021-06-30 14:45:09
 */
public interface IDevHisService extends IBaseService<DevHis> {

    /**
     * 列表获取
     *
     * @param devHisDto
     * @return
     */
    PageVo<DevHis> queryList(DevHisDto devHisDto, String tableName);

    PageVo<AlarmRecord> queryAlarmList(AlarmRecordDto alarmRecordDto);

    PageVo<DevHisVo> queryDevHisByRelationId(String relationId, long pageNum, long limit);

    void updateAndInsertImg(DevHis devHis) throws Exception;

    int getFireNum(String s);

    int getWait(String s);

    /**
     * 火警率
     *
     * @param start
     * @param end
     * @param unitId
     * @return
     */
    int getFireRateScore(String start, String end, String unitId);

    /**
     * 火警故障率得分
     *
     * @param start
     * @param end
     * @param unitId
     * @return
     */
    int getFireGZRateScore(String start, String end, String unitId);

    int getFaultNotReadNum(String unitId);


    /**
     * 获取设备信息
     *
     * @param relationId
     * @return
     */
    DevHis queryByRelationId(String relationId);

    PageVo<DevHisVo> getFaultList(long pageNum, long limit, Map<String, String> params);

    PageVo<DevHisVo> getOtherList(long pageNum, long limit, String unitId);

    DevHis getDevHisById(String id);

    int isExistTable(String tableName);


    int updateDevHis(DevHis devHis);


}

